import { hvigor } from "@ohos/hvigor";
import { appTasks } from '@ohos/hvigor-ohos-plugin';
import { turboTransJsonPlugin } from "@hadss/turbo-trans-json-plugin";
import { appPlugin } from "@hadss/hmrouter-plugin";

// import { ClassTransformerCodeGenPlugin } from 'quick-transformer-codegen-plugin';

export default {
  system: appTasks,
  plugins: [
    turboTransJsonPlugin(hvigor, {
      ignoreModuleNames: ['TurboTransCore' , 'TurboTransJSON',  'PerformanceBaseline'],
      scanDir: ['src/main/ets'],
      deserializationMode: 'performance',
      importRewrite: {
        scanPaths: ['src/main/ets', 'src/ohosTest/ets'],
        preserveOriginalImports: false
      }
    }),
    appPlugin({ ignoreModuleNames: ['TurboTransCore', 'TurboTransJSON', 'PerformanceBaseline'] }),
    // 目前quick-transformer的插件和HMRouter的插件存在冲突, 暂时的处理方案是保留quick-transformer生成的代码, 并移除其插件
    // 所以插件配置并未直接删除.
    // ClassTransformerCodeGenPlugin(hvigor, {
    //   enable: true,
    //   preventModifySourceCode: false, //是否避免修改源码, 默认 true
    //   // whiteDirList: 源代码文件**父**路径白名单, 从工程根目录开始
    //   whiteDirList: ['/HMSerializationSample/PerformanceBaseline/src/main/ets/models/'],
    //   // blackDirList: 源代码文件**父**路径黑名单, 从工程根目录开始
    //   blackDirList: []
    //   // whiteDirList 和 blackDirList 都不配置的情况, 默认对工程进行全扫描
    // })
  ]
};